SUBDIRS = ml_reactor ml_dns ml_reporter ml_loadbalance_agent api/cpp/ml_api api/cpp/example ml_reactor/example/qps_test online_oj

.PHONY: all cpp_mlweb

all: cpp_mlweb
	@list='$(SUBDIRS)'; for subdir in $$list; do \
		echo "Building in $$subdir";\
		$(MAKE) -C $$subdir;\
	done

cpp_mlweb:
	@echo "Building cpp_mlweb..."
	@mkdir -p cpp_mlweb/build
	@cd cpp_mlweb/build && cmake .. && make

.PHONY: clean

clean: clean_cpp_mlweb
	@echo Making clean
	@list='$(SUBDIRS)'; for subdir in $$list; do \
		echo "Clean in $$subdir";\
		$(MAKE) -C $$subdir clean;\
	done

clean_cpp_mlweb:
	@echo "Cleaning cpp_mlweb..."
	@rm -rf cpp_mlweb/build
